function IndexClass(){
	this.init=function(){
		var obthis=this;
	    $(".gotoCon").unbind();
	    $(".gotoCon").on("click",function(){
	    	if($(this).attr("code")!=undefined && $(this).attr("code")!=''){
	    		var code=$(this).attr("code");
	    		$("html,body").animate({scrollTop:$("#"+code).offset().top-100},500);
	    	}
	    });
	    $(".advantage_img img").unbind();
		$(".advantage_img img").hover(function(){
			var id=$(this).attr("code");
			$(this).attr("src","img/index/"+id+"_focus.png");
		},function(){
			var id=$(this).attr("code");
			$(this).attr("src","img/index/"+id+".png");
		}).on("click",function(){
			var id=$(this).attr("code");
			$(this).attr("src","img/index/"+id+"_focus.png");
			$(".advantage").hide();
			$("#"+id).show();
			$("html,body").animate({scrollTop:$("#product_advantage_top").offset().top-100},500);
		});
		$(".product_introduce_con img").unbind();
		$(".product_introduce_con img").hover(function(){
			var val=$(this).attr("value");
			$(this).attr("src","img/index/"+val+"_focus.jpg");
		},function(){
			var val=$(this).attr("value");
			$(this).attr("src","img/index/"+val+".jpg");
		}).on("click",function(){
			var code=$(this).attr("code");
			var val=$(this).attr("value");
			$(this).attr("src","img/index/"+val+"_focus.jpg");
			if(code=="1"){
				$("#product_introduce_detail1").show();
				$("#product_introduce_detail2").hide();
				$("html,body").animate({scrollTop:$(".product_introduce_con").offset().top-100},500);
			}else{
				$("#product_introduce_detail1").hide();
				$("#product_introduce_detail2").show();
				$("html,body").animate({scrollTop:$(".product_introduce_con").offset().top-100},500);
			}
		});
		$("#login_span").on("click",function(){
			window.location.href='http://114.251.219.34:8080/kangfu/';
		});

		$(window).resize(function(){
			obthis.resize();
		});
	};
	this.resize=function(){
		var img_width=$("#map_img").width();
		var img_height=$("#map_img").height();
		var width=img_width*710/1903;
		var height=img_height*280/737;
		$("#map_area1").attr("coords",width+","+height+","+(img_width/1600*35));
	};
}
var indexClass=null;
$(document).ready(function(){
	indexClass=new IndexClass();
	indexClass.init();
	document.getElementById("map_img").onload=function(){
		indexClass.resize();
	};
});
